package com.taa.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.management.loading.MLetContent;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum ResponseCode {

    SUCCESS("0000", "成功"),
    UN_ERROR("0001", "未知失败"),
    ILLEGAL_PARAMETER("0002", "非法参数"),

    // 用户服务相关 1xxx
    USER_PASSWORD_ERROR("1001", "用户名或密码错误"),
    USERNAME_ALREADY_EXISTS("1002", "用户名已存在"),
    USER_REGISTER_FAILED("1003", "用户注册失败"),
    USER_NOT_EXIST("1004", "用户不存在"),
    
    // 订单服务相关 2xxx
    ORDER_CREATE_FAILED("2001", "订单创建失败"),
    STOCK_NOT_ENOUGH("2002", "商品库存不足"),
    ORDER_NOT_FOUND("2003", "订单不存在"),
    
    // 餐厅服务相关 3xxx
    RESTAURANT_NOT_FOUND("3001", "商家不存在"),

    // 支付服务相关 4xxx
    PAYMENT_FAILED("4001", "支付处理失败"),
    ORDER_STATUS_UPDATE_FAILED("4002", "订单状态更新失败"),
    
    ;

    private String code;
    private String info;

}
